Finish implementing `cargo install`
authorAlex Crichton <alex@alexcrichton.com>
Mon, 5 Oct 2015 22:29:15 +0000 (15:29 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 19 Oct 2015 04:44:01 +0000 (21:44 -0700)
commitbc60f64b13d267dcc3b4c0194944a678182a610e
tree39293b1171c85342b3329112841308203ef5b1a6
parentf8308bc54345fe52ef3a24d98c4c38d92180662d
Finish implementing `cargo install`

This commit is an implementation of [RFC 1200][rfc] which brings two new
subcommands: `cargo install` and `cargo uninstall`. Most of this is a straight
implementation of the RFC, but a few tweaks were made:

* The `-p` or `--package` arguments are no longer needed as you just pass
  `crate` as a bare argument to the command, this means `cargo install foo`
  works and downloads from crates.io by default.
* Some logic around selecting which crate in a multi-crate repo is installed has
  been tweaked slightly, but mostly in the realm of "let's do the thing that
  makes sense" rather than the literal "let's do what's in the RFC".
  Specifically, we don't pick a crate with examples if there are multiple crates
  with binaries (instead an error is generated saying there are multiple binary
  crates).

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1200-cargo-install.md
21 files changed:
src/bin/cargo.rs
src/bin/install.rs
src/bin/uninstall.rs [new file with mode: 0644]
src/cargo/core/package_id_spec.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/source.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_install.rs
src/cargo/ops/cargo_package.rs
src/cargo/ops/cargo_pkgid.rs
src/cargo/ops/mod.rs
src/cargo/ops/resolve.rs
src/cargo/sources/git/source.rs
src/cargo/sources/path.rs
src/cargo/sources/registry.rs
src/cargo/util/config.rs
tests/support/mod.rs
tests/support/registry.rs
tests/test_cargo_install.rs [new file with mode: 0644]
tests/tests.rs